package cn.pfz.Service.impl;

import cn.pfz.Service.IConsumptionReportService;
import cn.pfz.domain.Business;
import cn.pfz.domain.BusinessReport;
import cn.pfz.mapper.ConsumptionReportMapper;
import cn.pfz.query.BusinessReportQuery;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 普发忠
 * @Date: 2021/09/14/9:10
 */
@Service
public class IConsumptionReportServiceimpl implements IConsumptionReportService {
    @Autowired
    private ConsumptionReportMapper consumptionReportMapper;
    
    
    @Override
    public PageInfo<BusinessReport> list(BusinessReportQuery qo) {
        //通过pageHelper进行设置分页及排序
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize(),qo.getGroupcondition()+ "   desc");
        //在Sql中不需要limit
        List<BusinessReport> list = consumptionReportMapper.list(qo);
        PageInfo<BusinessReport> PageInfo = new PageInfo(list);
        return PageInfo;
    }
}
